{include "Public/header"}
<div class="container-fluid">
  <div class="row-fluid">
    <div class="span12">
      <div class="widget-box">
        <div class="widget-title"> <span class="icon"> <i class="icon-align-justify"></i> </span>
          <h5>{$title}</h5>
        </div>
        <div class="widget-content nopadding">
          <form action="" method="post" class="form-horizontal">
          {if isset($info)}
          <input type="hidden" name="id" value="{$info['id']}" />
          {/if}
          	<div class="control-group">
              <label class="control-label">ID</label>
              <div class="controls">
                <input type="text" maxlength="255" name="uid" class="span11" value="{$info['uid']|''}" placeholder="ID" />
              </div>
            </div>
            <div class="control-group">
              <label class="control-label">Name</label>
              <div class="controls">
                <input type="text" name="name" class="span11" maxlength="100" value="{$info['name']|''}"  placeholder="please input the name" />
              </div>
            </div>
            <div class="control-group">
              <label class="control-label">Gender</label>
              <div class="controls">
                <select name="gender">
                	{foreach gender() as $k=>$v}
                		<option value="{$k}">{$v}</option>
                	{/foreach}
                </select>
              </div>
            </div>
            <div class="control-group">
              <label class="control-label">Position</label>
              <div class="controls">
                <input type="text" maxlength="255" name="position" class="span11" value="{$info['position']|''}" placeholder="input the position" />
              </div>
            </div>
            <div class="control-group">
              <label class="control-label">Remark</label>
              <div class="controls">
                <textarea class="span11" name="remark" maxlength="255" placeholder="remark">{$info['remark']}</textarea>
              </div>
            </div>
            <div class="form-actions">
              <input type="submit" class="btn btn-success" value="save">
            </div>
          </form>
        </div>
      </div>
     </div>
</div></div>
{include "Public/footer"}
<script>
$(function(){
	jQuery.validator.addMethod("mobile", function(value, element) {
		var length = value.length;
		var mobile =  /^(((13[0-9]{1})|(15[0-9]{1})|(17[0-9]{1})|(18[0-9]{1}))+\d{8})$/
		return this.optional(element) || (length == 11 && mobile.test(value));
	}, "Mobile phone format is not correct");
	$("form").validate({
		rules:{
			name:{
				required:true,
				rangelength:[2,100]
			}
		},
		messages:{
			name:{
				required:"required",
				rangelength:"Between 2-100 length"
			}
		}
	});
});
</script>